package com.hup.vd.model;

import com.hup.utils.commons.ListUtil;
import com.hup.utils.commons.io.BaseConfig;
import com.hup.vd.model.bo.TaskCreateReq;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * @author hugan
 * @date 2022/1/10
 */
@Data
public class TaskTestConfig implements BaseConfig<TaskTestConfig> {

    private List<TaskCreateReq> reqs = new ArrayList<>();

    @Override
    public boolean afterLoadFromFileOrReset(TaskTestConfig fileConfig) {
        if (fileConfig == null || ListUtil.nullOrEmpty(fileConfig.reqs)) {
            TaskCreateReq req = new TaskCreateReq();
            req.setUrl("url,m3u8内容");
            req.setFilePath("全路径");
            reqs.add(req);
            return true;
        }
        return false;
    }
}
